﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;



public partial class NewStudent : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void ReturnBtn_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/Students.aspx");
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        int student_id = Convert.ToInt32(TextBox1.Text);
        string fname = Convert.ToString(TextBox2.Text);
        string lname = Convert.ToString(TextBox3.Text);
        double gpa = Convert.ToDouble(TextBox4.Text);
        string email = Convert.ToString(TextBox5.Text);
        int faculty_id = Convert.ToInt32(TextBox6.Text);

        StudentDataSource.InsertStudent(student_id, fname, lname, gpa, email,faculty_id, student_id, fname, lname);
        Response.Redirect("~/NewStudent.aspx");
    }
}